package main

import "fmt"

type User struct {
}
type MyUser1 User
type MyUser2 = User

func (i MyUser1) m1() {
	fmt.Println("MyUser1.m1")
}
func (i User) m2() {
	fmt.Println("User.m2")
}

type T1 struct {
}

func (t T1) m1() {
	fmt.Println("T1.m1")
}

type T2 = T1
type MyStruct struct {
	T1
	T2
}

func main() {
	type MyInt1 int
	type MyInt2 = int
	//var i int = 9
	//编译会报错，不能将i赋值给i1，因为类型不同
	//var i1 MyInt1 = i
	//可以将i赋值给i2，因为alias声明MyInt2类型为int类型的别名
	//var i2 MyInt2 = i
	//fmt.Println(i1, i2)

	var iu1 MyUser1
	var iu2 MyUser2
	iu1.m1()
	iu2.m2()

	my := MyStruct{}
	//my.m1()
	my.T1.m1()
	my.T2.m1()
}
